# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BigQuery.V2.Model.RemoteFunctionOptions do
  @moduledoc """
  Options for a remote user-defined function.

  ## Attributes

  *   `connection` (*type:* `String.t`, *default:* `nil`) - Fully qualified name of the user-provided connection object which holds the authentication information to send requests to the remote service. Format: ```"projects/{projectId}/locations/{locationId}/connections/{connectionId}"```
  *   `endpoint` (*type:* `String.t`, *default:* `nil`) - Endpoint of the user-provided remote service, e.g. ```https://us-east1-my_gcf_project.cloudfunctions.net/remote_add```
  *   `maxBatchingRows` (*type:* `String.t`, *default:* `nil`) - Max number of rows in each batch sent to the remote service. If absent or if 0, BigQuery dynamically decides the number of rows in a batch.
  *   `userDefinedContext` (*type:* `map()`, *default:* `nil`) - User-defined context as a set of key/value pairs, which will be sent as function invocation context together with batched arguments in the requests to the remote service. The total number of bytes of keys and values must be less than 8KB.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :connection => String.t() | nil,
          :endpoint => String.t() | nil,
          :maxBatchingRows => String.t() | nil,
          :userDefinedContext => map() | nil
        }

  field(:connection)
  field(:endpoint)
  field(:maxBatchingRows)
  field(:userDefinedContext, type: :map)
end

defimpl Poison.Decoder, for: GoogleApi.BigQuery.V2.Model.RemoteFunctionOptions do
  def decode(value, options) do
    GoogleApi.BigQuery.V2.Model.RemoteFunctionOptions.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BigQuery.V2.Model.RemoteFunctionOptions do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
